package org.laobai.shop.admin.controller;

import java.util.List;

import org.apache.dubbo.config.annotation.DubboReference;
import org.laobai.shop.goods.entity.Category;
import org.laobai.shop.goods.service.CategoryService;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
@RequestMapping("category")
public class CategoryController {
	@DubboReference
	private CategoryService categoryService;

	@RequestMapping("list")
	public String category() {
		// TODO 携带数据
		return "/category/list";
	}
	
	@RequestMapping("tree")
	@ResponseBody
	public List<Category> getTreeByPid(Integer pid){
		return categoryService.getTreeByPid(pid);
	}

}
